/*
-----------------------------------------------------------------------------
This source file is part of DIVA
The project of Engineering Lab, dept. of CSIE, NTNU.

Copyright (c) 2000-2006 The Software Engineering Lab, dept. of CSIE, NTNU.
-----------------------------------------------------------------------------
Filename:    Reference.h
Description: 
update history	8/29	增加ReferenceVM(xParameterPack)的建構子以呼叫DIVA_VM(xpp)
						的建構子，提供給child rtvm呼叫以連結port attribute
						增加ReferenceVM()的建構子提供DummyVM呼叫

-----------------------------------------------------------------------------
*/
/*------------------------------------------------------------*/
#ifndef _ReferenceVM_H_
#define	_ReferenceVM_H_
/*------------------------------------------------------------*/

#include "DIVA_VM.h"
#include <string>
#include "xParameterPack.h"

using namespace std;

class ReferenceVM: public DIVA_VM {
protected:

	/// body VM is the vm this reference pointed to.
	DIVA_VM *  _pointedVM;
	ReferenceVM(){};
	ReferenceVM(xParameterPack xpp):DIVA_VM(xpp){};

public:

	/// retrun the vm this rtvm pointed to.
	void setBodyVM(DIVA_VM *v) { _pointedVM =  v ; }
	DIVA_VM* getBodyVM(){return _pointedVM;}
	virtual string getVMType() { return string("reference"); }
	virtual bool isPointedNULL() { 
		if (_pointedVM == NULL) return true ;
		else return false ;
	}

};
/*------------------------------------------------------------*/
#endif	
/*------------------------------------------------------------*/